package com.smartcommunity.base.common;


import com.smartcommunity.exception.BusinessException;

import javax.servlet.http.HttpServletResponse;
import java.sql.SQLException;
import java.util.List;

/**
 * Copyright: Copyright (c) 2018
 * Company:
 *
 * @author heweiwei
 * @description 数据导入入库操作接口
 * @date 2018/8/30
 */
public interface DataImport {

    /**
     * 数据导入接口
     *
     * @param list        excel数据列表
     * @param villageCode 小区编码
     * @param fileName excel表名
     * @param taskId 跟踪excel导入进度的任务ID
     * @param response 会话response
     * @throws SQLException             数据库操作异常
     * @throws IllegalArgumentException 请求参数异常
     * @throws BusinessException        业务流程异常
     */
    String importData(List list, String villageCode, String fileName,String taskId,HttpServletResponse response) throws SQLException, IllegalArgumentException, BusinessException;

    /**
     * 获取导入进度接口
     * @param taskId 跟踪excel导入进度的任务ID
     * @return 导入进度
     */
    int getImportDataProgress(String taskId);
}
